package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppStartPageMapper;
import com.ruoyi.system.domain.AppStartPage;
import com.ruoyi.system.service.IAppStartPageService;
import com.ruoyi.common.core.text.Convert;

/**
 * app启动页设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-25
 */
@Service
public class AppStartPageServiceImpl implements IAppStartPageService 
{
    @Autowired
    private AppStartPageMapper appStartPageMapper;

    /**
     * 查询app启动页设置
     * 
     * @param id app启动页设置ID
     * @return app启动页设置
     */
    @Override
    public AppStartPage selectAppStartPageById(Long id)
    {
        return appStartPageMapper.selectAppStartPageById(id);
    }

    /**
     * 查询app启动页设置列表
     * 
     * @param appStartPage app启动页设置
     * @return app启动页设置
     */
    @Override
    public List<AppStartPage> selectAppStartPageList(AppStartPage appStartPage)
    {
        return appStartPageMapper.selectAppStartPageList(appStartPage);
    }

    /**
     * 新增app启动页设置
     * 
     * @param appStartPage app启动页设置
     * @return 结果
     */
    @Override
    public int insertAppStartPage(AppStartPage appStartPage)
    {
        appStartPage.setCreateTime(DateUtils.getNowDate());
        return appStartPageMapper.insertAppStartPage(appStartPage);
    }

    /**
     * 修改app启动页设置
     * 
     * @param appStartPage app启动页设置
     * @return 结果
     */
    @Override
    public int updateAppStartPage(AppStartPage appStartPage)
    {
        appStartPage.setUpdateTime(DateUtils.getNowDate());
        return appStartPageMapper.updateAppStartPage(appStartPage);
    }

    /**
     * 删除app启动页设置对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAppStartPageByIds(String ids)
    {
        return appStartPageMapper.deleteAppStartPageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除app启动页设置信息
     * 
     * @param id app启动页设置ID
     * @return 结果
     */
    @Override
    public int deleteAppStartPageById(Long id)
    {
        return appStartPageMapper.deleteAppStartPageById(id);
    }

    /**
     * 获取app启动页内容
     * @return
     */
    @Override
    public AppStartPage getAppStartPage() {
        return appStartPageMapper.getAppStartPage();
    }
}
